<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
        /* 弹窗样式 */
        #dialog {
            position: relative;
            border-color: rgb(180, 178, 178);
            border-radius: 6px;
            width: 500px;
            height: 350px;
            padding: 0;
            overflow: hidden;
            border-width: 2px;
        }

        /* 弹窗遮罩层样式 */
        #dialog::backdrop {
            background-color: rgba(0, 0, 0, .5);
        }
   
        #dialog .dialog-title {
            width: 100%;
            height: 35px;
            background-color: skyblue;
            padding: 0 0 0 15px;
            margin: 0;
            line-height: 35px;
        }
        .context{
            padding: 10px;
        }
        .close-btn {
            position: absolute;
            bottom: 15px;
            left: 45%;
        }
    </style>
</head>

<body>
    <button onclick="dialog.showModal()">弹窗</button>
    <dialog id="dialog">
        <div class="con">
            <h4 class="dialog-title">弹窗</h4>
            <div class="context">
                <p>This is a window</p>
                <input type="text">
                <input type="text">
                <input type="text">
                <input type="text">
            </div>
            <button onclick="dialog.close()" class="close-btn">关闭</button>
        </div>
    </dialog>
</body>

</html>